package com.zzc.mapper;

import com.select.pojo.Achievement;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AchievementMapper {
    @Select("select * from achievement where cou_id=#{couId}")
    public List<Achievement> findone(String couId);
    @Select("select * from achievement where stu_account=#{stuAccount} and cou_id=#{couId}")
    public Achievement findstuone(@Param("stuAccount")String stuAccount,@Param("couId")String couId);
    @Select("select * from achievement where stu_account=#{stuAccount}")
    public Achievement findone1(String stuAccount);
    @Insert("insert into achievement (ach_id,ach_num,tea_account,cou_id,stu_account,semester,ach_end,ach_day,ach_end_Proportion,ach_day_Proportion) values(#{achId},#{achNum},#{teaAccount},#{couId},#{stuAccount},#{semester},#{achEnd},#{achDay},#{achEndProportion},#{achDayProportion}) ")
    public Integer add(@Param("achId")String achId,
                   @Param("achNum")double achNum,
                   @Param("teaAccount")String teaAccount,
                   @Param("couId")String couId ,@Param("stuAccount")String stuAccount,
                   @Param("semester")String semester, @Param("achEnd")double achEnd,
                   @Param("achDay")double achDay, @Param("achEndProportion")double achEndProportion,
                   @Param("achDayProportion")double achDayProportion);
    @Update("update achievement set ach_end=#{achEnd},ach_day=#{achDay},ach_num=#{achNum} where stu_account=#{stuAccount}")
    public Integer upda(@Param("achEnd") String achEnd,@Param("achDay") String achDay,@Param("achNum") String achNum,@Param("stuAccount") String stuAccount);
}